package com.flyqiu.flow.model.entity.base;

import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.annotation.TableField;
import com.flyqiu.common.mybaits.plus.type.MyBaitsFastJson2ObjectHandler;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;

/**
 * 流程实例基础信息
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class ProcInst extends FlowBaseDao {
    /**
     * 流程实例名称
     */
    @TableField("PROC_INST_NAME_")
    private String procInstName;
    /**
     * 活动id
     */
    @TableField("ACT_ID_")
    private String actId;
    /**
     * 流程发布定义id
     */
    @TableField("PROC_DEPLOY_DEF_ID_")
    private String procDeployDefId;
    /**
     * 流程发布定义key
     */
    @TableField("PROC_DEPLOY_DEF_KEY_")
    private String procDeployDefKey;
    /**
     * 附件流程id
     */
    @TableField("PARENT_ID_")
    private String parentId;
    /**
     * 父级流程定义key
     */
    @TableField("PARENT_PROC_DEF_KEY_")
    private String parentProcDefKey;
    /**
     * 流程层级keys
     */
    @TableField("PARENT_LEVEL_DEF_KEYS_")
    private String parentLevelDefKeys;
    /**
     * 流程业务key
     */
    @TableField("BUSINESS_KEY_")
    private String businessKey;
    /**
     * 流程业务id
     */
    @TableField("BUSINESS_ID_")
    private String businessId;
    /**
     * 流程业务参数
     */
    @TableField(value = "BUSINESS_PARAMS_", typeHandler = MyBaitsFastJson2ObjectHandler.class)
    private JSONObject businessParams;
    /**
     * 流程发起人key（一般标识用户类型）
     */
    @TableField("START_USER_KEY_")
    private String startUserKey;
    /**
     * 流程发起人id
     */
    @TableField("START_USER_ID_")
    private String startUserId;
    /**
     * 流程发起人昵称
     */
    @TableField("START_USER_NICK_NAME_")
    private String startUserNickName;

    /**
     * 流程发起人唯一key
     */
    @TableField("START_USER_UNIQUE_KEY_")
    private String startUserUniqueKey;

    /**
     * 发起人扩展信息
     */
    @TableField(value = "START_USER_ATTR_", typeHandler = MyBaitsFastJson2ObjectHandler.class)
    private JSONObject startUserAttr;

    /**
     * 流程状态 参考{@link com.flyqiu.flow.common.enums.ProcInstStatus}
     */
    @TableField("STATUS_")
    private Integer status;
    /**
     * 创建时间
     */
    @TableField("CREATE_TIME_")
    private LocalDateTime createTime;
    /**
     * 租户id
     */
    @TableField("TENANT_ID_")
    private String tenantId;
}
